<template>
  <div id="app">
    <h2>测试题</h2>
    <Subject v-for="(item,index) in list" :key="index"
    :index="index"
    @addFn='addNum'
    ></Subject>
    <div>
      <Flag v-for="(item,index) in list" :key="index"
      :index="index"
      :results="item"
      ></Flag>
    </div>
  </div>
</template>

<script>
import Subject from './zujian/Subject.vue'
import Flag from './zujian/Flag.vue'
export default {
  data(){
    return{
      list:['未完成','未完成','未完成','未完成','未完成']
    }
  },
  components:{
    Subject,
    Flag
  },
  methods:{
 addNum(r,i){
    this.$set(this.list,i,r)
  }
  }
};
</script>

<style>
body {
  background-color: #eee;
}

#app {
  background-color: #fff;
  width: 500px;
  margin: 50px auto;
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
  padding: 2em;
}
</style>